#pragma once

#include <vector>
#include "IGUIElement.h"

class GUITree;

class GUITreeNode
{
public:
	typedef std::vector<Pointer<GUITreeNode>> Vector_t;

	GUITreeNode();

	void Title( std::string& title );
	std::string Title() const;
	
	void Open( bool open );
	bool Open() const;
	void AddChildNode( Pointer<GUITreeNode>& child );
	Pointer<GUITreeNode> FindChildNode( GUITreeNode* child );	// Takes a while
	void RemoveChild( unsigned int index );
	void RemoveChild( GUITreeNode* child );
	GUITreeNode::Vector_t& Children();

	void ParentTree( GUITree* tree );
	GUITree* ParentTree() const;
protected:
	bool m_isOpen;
	std::string m_title;
	GUITreeNode::Vector_t m_nodes;
	GUITree* m_parentTree;
};